home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’97 / Warrior’s Progress / source code / Source / Libraries / Trees / LinkLoop.h < prev    next >
Encoding:
Text File  |  1997-06-28  |  696 b   |  35 lines  |  [TEXT/CWIE]

  1. // LinkLoop.h
  2.  
  3. #ifndef LinkLoop_h
  4. #define LinkLoop_h
  5.  
  6. #ifndef DowncastLoop_h
  7. #include "DowncastLoop.h"
  8. #endif
  9.  
  10. template < class Inherited,
  11.               class HeadType,
  12.               class HeadBase,
  13.               class NodeType,
  14.               class NodeBase,
  15.               class Content >
  16. class LinkLoop: public DowncastLoop< Inherited,
  17.                                                  HeadType,
  18.                                                  HeadBase,
  19.                                                  NodeType,
  20.                                                  NodeBase >
  21.   {
  22.     private:
  23.         typedef DowncastLoop< Inherited,
  24.                                      HeadType,
  25.                                      HeadBase,
  26.                                      NodeType,
  27.                                      NodeBase > BaseLoop;
  28.     
  29.     public:
  30.         const Content& operator*() const        { return *BaseLoop::operator*() ); }
  31.         const Content *operator->() const    { return &*BaseLoop::operator*() ); }
  32.   };
  33.  
  34. #endif
  35.